<template>
	<view>
		<cu-custom :bgColor="'bg-'+theme.backgroundColor" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">提现详情</block>
		</cu-custom>
		<view class="bg-white font-weight padding withdraw-bg">
			<view class="text-center">
				<view class="text-xxl text-sm margin-top-sm text-bold text-price">{{userwithdrawRecord.amount}}</view>
				<view class="margin-top-sm text-orange" v-if="userwithdrawRecord.status==0">审核中</view>
				<view class="margin-top-sm text-green" v-if="userwithdrawRecord.status==1">审核通过</view>
				<view class="margin-top-sm text-red" v-if="userwithdrawRecord.status==2">审核不通过</view>
			</view>
			<view class="cu-list padding">					
				<view class="cu-item flex justify-between margin-top">
					<view class="text-gray text-sm">提现方式</view>
					<view class="text-sm">微信零钱</view>
				</view>
				<view class="cu-item flex justify-between margin-top">
					<view class="text-gray text-sm">提现类型</view>
					<view class="text-sm">佣金提现</view>
				</view>				
				<view class="cu-item flex justify-between margin-top">
					<view class="text-gray text-sm">申请时间</view>
					<view class="text-sm">{{userwithdrawRecord.createTime}}</view>
				</view>
				<view class="cu-item flex justify-between margin-top">
					<view class="text-gray text-sm">审核时间</view>
					<view class="text-sm">{{userwithdrawRecord.applyTime?userwithdrawRecord.applyTime:'-'}}</view>
				</view>
				<view class="cu-item flex justify-between margin-top">
					<view class="text-gray text-sm">审核明细</view>
					<view class="text-sm">{{userwithdrawRecord.memo?userwithdrawRecord.memo:'-'}}</view>
				</view>
			</view>
		</view>
		<view class="padding-lr-xl flex justify-end">
			<navigator :url="'/pages/distribution/distribution-withdraw/index?id='+userwithdrawRecord.id" hover-class="none">
				<text class="text-sm text-blue" v-if="userwithdrawRecord.status==2" >重新提现</text>
			</navigator>
		</view>
	</view>
</template>

<script>

	const util = require("utils/util.js");
	const app = getApp();
	import api from 'utils/api'
	
	
	export default {
		filters:{			
			filterPaymentMethod(val){
				val = parseInt(val) - 1
				let methods =  ['银行卡', '微信零钱', '支付宝']
				return methods[val]
			},
			filterWithdrawType(val){
				val = parseInt(val) - 1
				let types =  ['分销拥金提现']
				return types[val]
			}
		},
		data() {
			return {
				CustomBar: this.CustomBar,
				theme: app.globalData.theme, //全局颜色变量
				id: '',
				userwithdrawRecord: {}
			}
		},
		onLoad(e){
			this.id = e.id
		},
		onShow(){
			this.initData()
		},
		methods: {
			initData(){
				api.userwithdrawRecord(this.id).then(res => {
					if(res.data) {
						this.userwithdrawRecord = res.data
					}
				});
			}
		}
	}
</script>

<style>
	.font-weight{
		font-weight: 300;
	}
	
	.withdraw-bg{
		width: 96%;
		margin: 30rpx auto; 
		border-radius: 20rpx;
	}
</style>
